﻿using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LogoController : MonoBehaviour
{

    readonly float _time = 2f;

    Sequence s;

    // Start is called before the first frame update
    void Start()
    {
        s = DOTween.Sequence();
        s.SetAutoKill(false);
        s.Append(transform.DOMove(new Vector3(0, 8, 0), _time).From().SetEase(Ease.OutBounce));
        s.Insert(_time * 0.2f, transform.DORotate(new Vector3(0, 0, 0), _time * 0.5f).SetEase(Ease.InOutBack));
        s.Pause();
    }

    // Update is called once per frame
    void Update()
    {
        if (!s.IsPlaying())
        {
            //s.Play();
            s.Restart();
        }

    }
}
